<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:cmp="clr-namespace:Citrix.Cmp;assembly=Citrix.Cmp.Wpf">

  <!--=========================================================================================-->
  <!-- Radio button that displays the "check" with a chunky tick icon. -->
  <Style TargetType="{x:Type RadioButton}" >
    <Setter Property="FontSize" Value="18"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RadioButton}">
          <Grid>
            <!-- Ensure the full area can be tapped on by the user. -->
            <Rectangle Fill="Transparent" Grid.Column="0" Grid.ColumnSpan="2"/>

            <Grid Margin="0,10">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>

              <!-- The custom text -->
              <ContentPresenter Margin="10,0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"/>

              <!-- The check/tick mark -->
              <Rectangle x:Name="Selected" Grid.Column="1"
                         Fill="{DynamicResource TickIconBrush}"
                         Width="20" Height="20" Margin="0,0,10,0" VerticalAlignment="Center"/>
            </Grid>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="false">
              <Setter TargetName="Selected" Property="Visibility" Value="Collapsed"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!--=========================================================================================-->
  <!-- Custom mobile friendly checkbox. -->
  <Style x:Key="ChunkyCheckBoxStyle" TargetType="{x:Type CheckBox}">
    <Setter Property="FontSize" Value="18"/>
    <Setter Property="Padding" Value="10"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type CheckBox}">
          <ControlTemplate.Resources>

            <DrawingBrush x:Key="TickBrush" Stretch="Uniform">
              <DrawingBrush.Drawing>
                <DrawingGroup>
                  <DrawingGroup.Children>
                    <GeometryDrawing Brush="#FF5275A5" Geometry="F1 M 5.04509,11.2657L 0,7.76942L 1.55231,5.82708L 4.65697,8.93484C 4.65697,8.93484 9.02296,0.87405 11.2545,-3.8147e-006L 13.583,2.33082C 13.583,2.33082 9.02296,4.07895 5.04509,11.2657 Z "/>
                  </DrawingGroup.Children>
                </DrawingGroup>
              </DrawingBrush.Drawing>
            </DrawingBrush>

            <sys:Double x:Key="BorderSize">26</sys:Double>
          </ControlTemplate.Resources>

          <Grid>
            <!-- Provides the target for drawing highlights, as well as ensuring the full area
            is available for hit testing. -->
            <Rectangle x:Name="Background" Fill="Transparent"/>

            <!-- We place the main layout in a separate grid so we have a top level element to
            apply the padding to. -->
            <Grid Margin="{TemplateBinding Padding}">
              
              <Grid.ColumnDefinitions>
                <!-- The check/tick -->
                <ColumnDefinition Width="Auto"/>
                <!-- Margin between check and content. -->
                <ColumnDefinition Width="10"/>
                <!-- Content presenter -->
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>

              <!-- The "check". We display a border with a tick inside it. -->
              <Border Width="{StaticResource BorderSize}" Height="{StaticResource BorderSize}"
                CornerRadius="3" BorderBrush="Gray" BorderThickness="1"
                SnapsToDevicePixels="True"
                HorizontalAlignment="Left">
                <Border.Background>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFD3D0D0" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                  </LinearGradientBrush>
                </Border.Background>

                <Rectangle x:Name="TheCheck" Fill="{StaticResource TickBrush}" Margin="3" Visibility="Hidden" />

              </Border>

              <!-- Content presenter. -->
              <ContentPresenter Grid.Column="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Content="{TemplateBinding Content}"
                                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                RecognizesAccessKey="True" VerticalAlignment="Center"/>

            </Grid>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="True">
              <Setter TargetName="TheCheck" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="Background" Property="Fill" Value="LightGray"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--=========================================================================================-->
  <!-- Defines a TextBox without border. -->
  <Style x:Key="NoBorderTextBoxStyle" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
    <Setter Property="Padding" Value="1"/>
    <Setter Property="AllowDrop" Value="true"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TextBox}">
          <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--=========================================================================================-->
  <!-- Defines a TextBox with a simple border. -->
  <Style x:Key="SimpleBorderTextBoxStyle" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
    <Setter Property="Padding" Value="3"/>
    <Setter Property="AllowDrop" Value="true"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TextBox}">
          <Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="3" Margin="{TemplateBinding Padding}">
            <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>